<?php
/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2017/12/30
 * Time: 下午10:59
 */

return [
    'MAIN_SERVER' => [
        'HOST' => '0.0.0.0',
        'PORT' => 9502,
        'SERVER_TYPE' => \EasySwoole\Core\Swoole\ServerManager::TYPE_WEB_SERVER,
        'SOCK_TYPE' => SWOOLE_TCP, //该配置项当为SERVER_TYPE值为TYPE_SERVER时有效
        'RUN_MODEL' => SWOOLE_PROCESS,
        'SETTING' => [
            'task_worker_num' => 30, //异步任务进程
            'task_max_request' => 100,
            'max_request' => 10000, //强烈建议设置此配置项
            'worker_num' => 12,
        ],
    ],
    'DEBUG' => true,
    'TEMP_DIR' => EASYSWOOLE_ROOT . '/Temp',
    'LOG_DIR' => EASYSWOOLE_ROOT . '/Log',
    'EASY_CACHE' => [
        'PROCESS_NUM' => 1, //若不希望开启，则设置为0
        'PERSISTENT_TIME' => 0, //如果需要定时数据落地，请设置对应的时间周期，单位为秒
    ],
    'CLUSTER' => [
        'enable' => false,
        'token' => null,
        'broadcastAddress' => ['255.255.255.255:9556'],
        'listenAddress' => '0.0.0.0',
        'listenPort' => 9556,
        'broadcastTTL' => 5,
        'serviceTTL' => 10,
        'serverName' => 'easySwoole',
        'serverId' => null,
    ],
    'cache' => [
        // 驱动方式（支持file/memcache/redis/xcache/wincache/sqlite）
        'type' => 'File',
        // 缓存保存目录
        'path' => EASYSWOOLE_ROOT . '/Temp/Cache/',
        // 缓存前缀
        'prefix' => '',
        // 缓存有效期 0表示永久缓存
        'expire' => 0,
    ],
    'captcha'  => [
        // 验证码字符集合
        'codeSet'  => '1234567890', 
        // 验证码字体大小(px)
        'fontSize' => 15, 
        // 是否画混淆曲线
        'useCurve' => true, 
         // 验证码图片高度
        'imageH'   => 30,
        // 验证码图片宽度
        'imageW'   => 100, 
        // 验证码位数
        'length'   => 4, 
        // 验证成功后是否重置        
        'reset'    => true
    ],
    'jwt' => [
        'key' => 'zhelishikey',
        'expire' => 3600
    ]
];
